package org.example;

import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import pers.rain.dynamiccompiledemo.plugin.*;

public class HitokotoPlugin implements IPlugin {
    @Override
    public String getContent() {
        HttpRequest httpRequest = HttpUtil.createGet("https://v1.hitokoto.cn?encode=json");
        HttpResponse res = httpRequest.execute();
        RespDTO respDTO = JSONUtil.toBean(res.body(), RespDTO.class);
        return "一言返回值：" + respDTO.getHitokoto();
    }
}
